<script lang="ts">
    import Highcharts from 'highcharts';
    import ExportingModule from 'highcharts/modules/exporting';
	import { Chart } from '@highcharts/svelte';

    import { chart_value } from '$lib/data';

    let options: Highcharts.Options = $state({});

    ExportingModule(Highcharts);
    // $effect(() => {
        options = {
			chart: {
				type: 'line',
				width: 480,
				height: 420
			},
			title: {
				text: '电机1'
			},
			series: [{
				name: "扭矩",
				data: $chart_value
			}],
			credits: {
				enabled: false // 不显示版权 logo
			}
        },
    // });
</script>

<div class="mt-4 grid place-items-center gap-1">
    <Chart  options={options} highcharts={Highcharts}></Chart>
</div>